home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: returning an array from function
- Date: 3 Apr 1996 23:34:50 GMT
- Organization: OpenVision
- Message-ID: <4jv1ur$4fa@spanky.pls.ov.com>
- References: <4jstd8$kh0@news1.sunbelt.net>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article kh0@news1.sunbelt.net, bourne@infoave.net (Rick Huebner) writes:
- >I have looked in several texts and looked through the faq for this question
- >and can't find a reference for my answer. I am trying to return an array, or
- >a pointer to the array, from a function. I have seen several examples of
- >returning a pointer, but it doesn't seem to work for me. My function is going
- >to return an array of integers where 1-80 of them will be significant. The
- >calling function will know how many integers are expected and will read them
- >off the array....If I can get the pointer back to the array. A friend of mine
- >told me to just make the array a global, but I don't want to do that if I can
- >help it. I would even resort to a recursive function that will pass the
- >integers back one at a time if that is possible. Does anyone have any
- >suggestions? I am open to anything and will go looking if you can tell me
- >where(hopefully online somewhere).
- >
- >Thanks...
- >
- >--
- >Rick Huebner EMT-P FF BS
- >Team OS/2 bourne@InfoAve.net
- >Warping along the Internet
- >
-
- Since the calling function will know how much storage is required, the
- calling function can provide local storage or dynamically allocated storage.
- Then the calling function can pass a pointer to this storage for use
- by your calculation routine.
-
- Fletcher.Glenn@ov.com
-
-